<template>
  <div>
    <el-form ref="ruleForm" v-loading="loading" :rules="ruleForm" :model="formInfo" label-position="right" label-width="150px">
      <div style="display: flex;">
        <div style="width: 30%;">
          <el-form-item label="出入码" prop="name">
            <span>{{ formInfo.leave_num || '无' }}</span>
          </el-form-item>
          <el-form-item label="学生姓名" prop="janitor_name">
            <span>{{ formInfo.studentName || '无' }}</span>
          </el-form-item>
          <el-form-item label="学部" prop="janitor_name">
            <span>{{ formInfo.departmentName }}</span>
          </el-form-item>
          <el-form-item label="年级" prop="janitor_name">
            <span>{{ formInfo.gradeName }}</span>
          </el-form-item>
          <el-form-item label="班级" prop="janitor_name">
            <span>{{ formInfo.calssName }}</span>
          </el-form-item>
          <el-form-item label="照片" prop="janitor_name">
            <img :src="formInfo.student.img" style="width: 100px;height: 100px;">
          </el-form-item>
          <el-form-item label="家长是否来接学生" prop="janitor_name">
            <span>{{ TESLIST[formInfo.is_take] || '无' }}</span>
          </el-form-item>
          <el-form-item label="何人来接" prop="janitor_name">
            <span>{{ formInfo.relationship || '无' }}</span>
          </el-form-item>
          <el-form-item label="家长照片" prop="janitor_name">
            <img :src="formInfo.parent.img" style="width: 100px;height: 100px;" v-if="formInfo.parent"/>
            <div v-else>无</div>
          </el-form-item>
          <el-form-item label="请假原因" prop="janitor_name">
            <span>{{ DISEASE[ formInfo.leave_reason] || '无' }}</span>
          </el-form-item>
          <el-form-item label="备注" prop="name">
            <span>{{ formInfo.remark || '无' }}</span>
          </el-form-item>
        </div>
        <div style="width: 50%;">
          <el-form-item label="体温(°)" prop="janitor_name">
            <span>{{ formInfo.temperature || '无' }}</span>
          </el-form-item>
          <el-form-item label="去往地址" prop="janitor_name">
            <span>{{ formInfo.address }}</span>
          </el-form-item>
          <el-form-item label="交通方式" prop="janitor_name">
            <span>{{ formInfo.transport || '无' }}</span>
          </el-form-item>
          <el-form-item label="请假时间" prop="janitor_name">
            <span>{{ formInfo.start_time }} 至 {{ formInfo.end_time }}</span>
          </el-form-item>
          <el-form-item label="创建时间" prop="janitor_name">
            <span>{{ formInfo.created_at }}</span>
          </el-form-item>
          <el-form-item label="出校时间" prop="janitor_name">
            <span>{{ formInfo.out_school_time || '暂未出校' }}</span>
          </el-form-item>
          <!--          <el-form-item label="销假时间" prop="janitor_name">-->
          <!--            <span>{{ formInfo.actual_arrival_school_time || '无' }}</span>-->
          <!--          </el-form-item>-->
          <el-form-item label="销假类型" prop="janitor_name">
            <span>{{ DISEASE[formInfo.cancellation_leave_type] || '暂未销假' }}</span>
          </el-form-item>
          <el-form-item label="疾病种类" prop="janitor_name">
            <span>{{formInfo.disease && sickType[formInfo.disease.type] || '无'}}</span>
          </el-form-item>
          <el-form-item label="疾病" prop="janitor_name">
            <span>{{formInfo.disease && formInfo.disease.name || '无'}}</span>
          </el-form-item>
          <el-form-item label="预计到校时间" prop="janitor_name">
            <span>{{ formInfo.estimated_arrival_school_time || '无' }}</span>
          </el-form-item>
          <el-form-item label="实际到校时间" prop="janitor_name">
            <span>{{ formInfo.actual_enter_school_time || '暂未到校' }}</span>
          </el-form-item>
        </div>
      </div>
    </el-form>
  </div>
</template>

<script>
import { DISEASE, TESLIST,sickType } from '@/views/constants'

export default {
  name: 'StudentDetail',
  props: {
    formInfo: Object,
    loading: Boolean,
    isAdd: Boolean
  },
  data() {
    return {
      DISEASE,
      TESLIST,
      sickType,
      select_class: [{
        type: 0,
        label: '1'
      }, {
        type: 1,
        label: '2'
      }, {
        type: 2,
        label: '3'
      }]
    }
  }
}
</script>
